package com.five.sbgroup5job.controller;
//21330174048马静
import com.five.sbgroup5job.entity.Sale;
import com.five.sbgroup5job.service.SaleService;
import com.five.sbgroup5job.vo.SaleVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/sale")

public class SaleController {
    @Resource
    private SaleService saleService;
    //查询
    @RequestMapping ("sales")
    public List<Sale> saleList(){
        return saleService.salelist();
    }
    //添加
    @RequestMapping ("salesAdd")
    public String saleList(@RequestBody SaleVo saleVo){
        return saleService.saleAdd(saleVo);
    }
    //更改
    @RequestMapping ("salesUpdate")
    public String saleList1(@RequestBody SaleVo saleVo){
        return saleService.saleUpdate(saleVo);
    }
    //删除
    @RequestMapping ("salesDelete")
    public String saleList2(@RequestBody SaleVo saleVo){
        return saleService.saleDelete(saleVo);
    }



}
